# Carnal Realms realm laws.
# Institutional law groups generally progress from weak to strong institutions.
# Gender-policy law groups describe social distribution and succession access, not quality.

law_groups = {
	cr_finance_law = {
		law_type = realm
	}
	cr_justice_law = {
		law_type = realm
	}
	cr_military_law = {
		law_type = realm
	}
	cr_female_authority_law = {
		law_type = realm
	}

	cr_ordination_law = {
		law_type = realm
	}
	cr_councilor_gender_law = {
		law_type = realm
	}
	# Dormant fantasy-submod hook. Keep Arcane Law commented out in core.
	# The fantasy submod should define the magic game rule and ship an
	# uncommented cr_arcane_law group/law set in its own law file.
	# cr_arcane_law = {
	# 	law_type = realm
	# }
	cr_commerce_law = {
		law_type = realm
	}
	cr_adventuring_law = {
		law_type = realm
	}
	cr_public_exhibition_law = {
		law_type = realm
	}
}

laws = {
	# Finance

	cr_finance_law_0 = {
		group = cr_finance_law
		default = yes

		allow = {
			OR = {
				has_law = cr_finance_law_1
				AND = {
					NOT = { has_law = cr_finance_law_0 }
					NOT = { has_law = cr_finance_law_1 }
					NOT = { has_law = cr_finance_law_2 }
					NOT = { has_law = cr_finance_law_3 }
					NOT = { has_law = cr_finance_law_4 }
				}
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_finance_law_1
				revoke_law = cr_finance_law_2
				revoke_law = cr_finance_law_3
				revoke_law = cr_finance_law_4
			}
		}

		tax_income = -0.5
		feudal_opinion = -5
		city_opinion = -5
		temple_opinion = -5
	}

	cr_finance_law_1 = {
		group = cr_finance_law

		allow = {
			OR = {
				has_law = cr_finance_law_0
				has_law = cr_finance_law_2
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.25
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_finance_law_0
				revoke_law = cr_finance_law_2
				revoke_law = cr_finance_law_3
				revoke_law = cr_finance_law_4
			}
		}
		tax_income = 1
		feudal_opinion = -2
		city_opinion = -2
		temple_opinion = -2
	}

	cr_finance_law_2 = {
		group = cr_finance_law
		
		allow = {
			OR = {
				has_law = cr_finance_law_1
				has_law = cr_finance_law_3
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_finance_law_0
				revoke_law = cr_finance_law_1
				revoke_law = cr_finance_law_3
				revoke_law = cr_finance_law_4
			}
		}
		tax_income = 3
		feudal_opinion = 2
		city_opinion = 2
		temple_opinion = 2
	}

	cr_finance_law_3 = {
		group = cr_finance_law

		allow = {
			OR = {
				has_law = cr_finance_law_2
				has_law = cr_finance_law_4
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.75
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_finance_law_0
				revoke_law = cr_finance_law_1
				revoke_law = cr_finance_law_2
				revoke_law = cr_finance_law_4
			}
		}

		tax_income = 6
		feudal_opinion = 3
		city_opinion = 5
		temple_opinion = 3
	}

	cr_finance_law_4 = {
		group = cr_finance_law

		allow = {
			has_law = cr_finance_law_3
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.5
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_finance_law_0
				revoke_law = cr_finance_law_1
				revoke_law = cr_finance_law_2
				revoke_law = cr_finance_law_3
			}
		}

		tax_income = 10
		feudal_opinion = 5
		city_opinion = 8
		temple_opinion = 5
	}

	# Justice

	cr_justice_law_0 = {
		group = cr_justice_law
		default = yes

		allow = {
			OR = {
				has_law = cr_justice_law_1
				AND = {
					NOT = { has_law = cr_justice_law_0 }
					NOT = { has_law = cr_justice_law_1 }
					NOT = { has_law = cr_justice_law_2 }
					NOT = { has_law = cr_justice_law_3 }
					NOT = { has_law = cr_justice_law_4 }
				}
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_justice_law_1
				revoke_law = cr_justice_law_2
				revoke_law = cr_justice_law_3
				revoke_law = cr_justice_law_4
			}
		}

		vassal_opinion = -8
		feudal_opinion = -5
		city_opinion = -5
		temple_opinion = -5
	}

	cr_justice_law_1 = {
		group = cr_justice_law

		allow = {
			OR = {
				has_law = cr_justice_law_0
				has_law = cr_justice_law_2
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.25
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_justice_law_0
				revoke_law = cr_justice_law_2
				revoke_law = cr_justice_law_3
				revoke_law = cr_justice_law_4
			}
		}

		vassal_opinion = -4
		feudal_opinion = -2
		city_opinion = -2
		temple_opinion = -2
	}

	cr_justice_law_2 = {
		group = cr_justice_law
		
		allow = {
			OR = {
				has_law = cr_justice_law_1
				has_law = cr_justice_law_3
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_justice_law_0
				revoke_law = cr_justice_law_1
				revoke_law = cr_justice_law_3
				revoke_law = cr_justice_law_4
			}
		}
	}

	cr_justice_law_3 = {
		group = cr_justice_law

		allow = {
			OR = {
				has_law = cr_justice_law_2
				has_law = cr_justice_law_4
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.75
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_justice_law_0
				revoke_law = cr_justice_law_1
				revoke_law = cr_justice_law_2
				revoke_law = cr_justice_law_4
			}
		}

		vassal_opinion = 4
		feudal_opinion = 3
		city_opinion = 3
		temple_opinion = 3
	}

	cr_justice_law_4 = {
		group = cr_justice_law

		allow = {
			has_law = cr_justice_law_3
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.5
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_justice_law_0
				revoke_law = cr_justice_law_1
				revoke_law = cr_justice_law_2
				revoke_law = cr_justice_law_3
			}
		}

		vassal_opinion = 8
		feudal_opinion = 5
		city_opinion = 5
		temple_opinion = 5
	}

	# Military

	cr_military_law_0 = {
		group = cr_military_law
		default = yes

		allow = {
			OR = {
				has_law = cr_military_law_1
				AND = {
					NOT = { has_law = cr_military_law_0 }
					NOT = { has_law = cr_military_law_1 }
					NOT = { has_law = cr_military_law_2 }
					NOT = { has_law = cr_military_law_3 }
					NOT = { has_law = cr_military_law_4 }
				}
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_military_law_1
				revoke_law = cr_military_law_2
				revoke_law = cr_military_law_3
				revoke_law = cr_military_law_4
			}
		}
		global_revolt_risk = 0.02
		vassal_opinion = -5
		feudal_opinion = -5
		castle_vassal_max_levy = -.05
	}

	cr_military_law_1 = {
		group = cr_military_law

		allow = {
			OR = {
				has_law = cr_military_law_0
				has_law = cr_military_law_2
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.25
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_military_law_0
				revoke_law = cr_military_law_2
				revoke_law = cr_military_law_3
				revoke_law = cr_military_law_4
			}
		}
		global_revolt_risk = 0.01
		vassal_opinion = -2
		feudal_opinion = -2
	}

	cr_military_law_2 = {
		group = cr_military_law
		
		allow = {
			OR = {
				has_law = cr_military_law_1
				has_law = cr_military_law_3
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_military_law_0
				revoke_law = cr_military_law_1
				revoke_law = cr_military_law_3
				revoke_law = cr_military_law_4
			}
		}
	}

	cr_military_law_3 = {
		group = cr_military_law

		allow = {
			OR = {
				has_law = cr_military_law_2
				has_law = cr_military_law_4
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.75
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_military_law_0
				revoke_law = cr_military_law_1
				revoke_law = cr_military_law_2
				revoke_law = cr_military_law_4
			}
		}

		castle_vassal_max_levy = 0.05
		global_revolt_risk = -0.01
		vassal_opinion = 3
		feudal_opinion = 3
	}

	cr_military_law_4 = {
		group = cr_military_law

		allow = {
			has_law = cr_military_law_3
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.5
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_military_law_0
				revoke_law = cr_military_law_1
				revoke_law = cr_military_law_2
				revoke_law = cr_military_law_3
			}
		}

		castle_vassal_max_levy = 0.1
		global_revolt_risk = -0.05
		vassal_opinion = 5
		feudal_opinion = 5
	}

	# ============================================================
	# Female Authority
	#
	# Controls which gender succession laws may be selected.
	# This law DOES NOT change succession automatically.
	# Tier 0 remains the generic fallback. Catholic realms are initialized to tier 2 at new-game startup.
	#
	# 0 - Agnatic
	# 1 - Adds Agnatic-Cognatic
	# 2 - Adds Absolute Cognatic
	# 3 - Adds Enatic-Cognatic
	# 4 - Adds Enatic
	# ============================================================

	cr_female_authority_law_0 = {
		group = cr_female_authority_law
		default = yes

		allow = {
			OR = {
				has_law = cr_female_authority_law_1
				AND = {
					NOT = { has_law = cr_female_authority_law_0 }
					NOT = { has_law = cr_female_authority_law_1 }
					NOT = { has_law = cr_female_authority_law_2 }
					NOT = { has_law = cr_female_authority_law_3 }
					NOT = { has_law = cr_female_authority_law_4 }
				}
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = {
			always = no
		}

		ai_will_do = {
			factor = 0.25
		}

		ai_will_revoke = {
			factor = 0
		}

		effect = {
			hidden_tooltip = {
				revoke_law = cr_female_authority_law_1
				revoke_law = cr_female_authority_law_2
				revoke_law = cr_female_authority_law_3
				revoke_law = cr_female_authority_law_4
			}
		}
	}

	cr_female_authority_law_1 = {
		group = cr_female_authority_law

		allow = {
			OR = {
				has_law = cr_female_authority_law_0
				has_law = cr_female_authority_law_2
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = {
			always = no
		}

		ai_will_do = {
			factor = 0.5
		}

		ai_will_revoke = {
			factor = 0
		}

		effect = {
			hidden_tooltip = {
				revoke_law = cr_female_authority_law_0
				revoke_law = cr_female_authority_law_2
				revoke_law = cr_female_authority_law_3
				revoke_law = cr_female_authority_law_4
			}
		}
	}

	cr_female_authority_law_2 = {
		group = cr_female_authority_law

		allow = {
			OR = {
				has_law = cr_female_authority_law_1
				has_law = cr_female_authority_law_3
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = {
			always = no
		}

		ai_will_do = {
			factor = 0.5
		}

		ai_will_revoke = {
			factor = 0
		}

		effect = {
			hidden_tooltip = {
				revoke_law = cr_female_authority_law_0
				revoke_law = cr_female_authority_law_1
				revoke_law = cr_female_authority_law_3
				revoke_law = cr_female_authority_law_4
			}
		}
	}

	cr_female_authority_law_3 = {
		group = cr_female_authority_law

		allow = {
			OR = {
				has_law = cr_female_authority_law_2
				has_law = cr_female_authority_law_4
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = {
			always = no
		}

		ai_will_do = {
			factor = 0.5
		}

		ai_will_revoke = {
			factor = 0
		}

		effect = {
			hidden_tooltip = {
				revoke_law = cr_female_authority_law_0
				revoke_law = cr_female_authority_law_1
				revoke_law = cr_female_authority_law_2
				revoke_law = cr_female_authority_law_4
			}
		}
	}

	cr_female_authority_law_4 = {
		group = cr_female_authority_law

		allow = {
			has_law = cr_female_authority_law_3
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = {
			always = no
		}

		ai_will_do = {
			factor = 0.5
		}

		ai_will_revoke = {
			factor = 0
		}

		effect = {
			hidden_tooltip = {
				revoke_law = cr_female_authority_law_0
				revoke_law = cr_female_authority_law_1
				revoke_law = cr_female_authority_law_2
				revoke_law = cr_female_authority_law_3
			}
		}
	}
	
	# ============================================================
	# Ordination
	#
	# Controls the sex weighting used when generating/selecting clergy.
	# Tier 0 remains the generic fallback. Catholic realms are initialized to tier 2 at new-game startup.
	#
	# 0 - Male:          100% male
	# 1 - Mostly Male:   75% male / 25% female
	# 2 - Equal:         50% male / 50% female
	# 3 - Mostly Female: 25% male / 75% female
	# 4 - Female:        100% female
	# ============================================================

	cr_ordination_law_0 = {
		group = cr_ordination_law
		default = yes

		allow = {
			OR = {
				has_law = cr_ordination_law_1
				AND = {
					NOT = { has_law = cr_ordination_law_0 }
					NOT = { has_law = cr_ordination_law_1 }
					NOT = { has_law = cr_ordination_law_2 }
					NOT = { has_law = cr_ordination_law_3 }
					NOT = { has_law = cr_ordination_law_4 }
				}
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.25 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_ordination_law_1
				revoke_law = cr_ordination_law_2
				revoke_law = cr_ordination_law_3
				revoke_law = cr_ordination_law_4
			}
		}
	}

	cr_ordination_law_1 = {
		group = cr_ordination_law

		allow = {
			OR = {
				has_law = cr_ordination_law_0
				has_law = cr_ordination_law_2
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.5 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_ordination_law_0
				revoke_law = cr_ordination_law_2
				revoke_law = cr_ordination_law_3
				revoke_law = cr_ordination_law_4
			}
		}
	}

	cr_ordination_law_2 = {
		group = cr_ordination_law

		allow = {
			OR = {
				has_law = cr_ordination_law_1
				has_law = cr_ordination_law_3
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.5 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_ordination_law_0
				revoke_law = cr_ordination_law_1
				revoke_law = cr_ordination_law_3
				revoke_law = cr_ordination_law_4
			}
		}
	}

	cr_ordination_law_3 = {
		group = cr_ordination_law

		allow = {
			OR = {
				has_law = cr_ordination_law_2
				has_law = cr_ordination_law_4
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.5 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_ordination_law_0
				revoke_law = cr_ordination_law_1
				revoke_law = cr_ordination_law_2
				revoke_law = cr_ordination_law_4
			}
		}
	}

	cr_ordination_law_4 = {
		group = cr_ordination_law

		allow = {
			has_law = cr_ordination_law_3
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.5 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_ordination_law_0
				revoke_law = cr_ordination_law_1
				revoke_law = cr_ordination_law_2
				revoke_law = cr_ordination_law_3
			}
		}
	}
	
	# ============================================================
	# Councilor Gender
	#
	# Controls the sex weighting used by councilor recruitment.
	# Tier 0 remains the generic fallback. Catholic realms are initialized to tier 2 at new-game startup.
	#
	# 0 - Male:          100% male
	# 1 - Mostly Male:   75% male / 25% female
	# 2 - Equal:         50% male / 50% female
	# 3 - Mostly Female: 25% male / 75% female
	# 4 - Female:        100% female
	# ============================================================

	cr_councilor_gender_law_0 = {
		group = cr_councilor_gender_law
		default = yes

		allow = {
			OR = {
				has_law = cr_councilor_gender_law_1
				AND = {
					NOT = { has_law = cr_councilor_gender_law_0 }
					NOT = { has_law = cr_councilor_gender_law_1 }
					NOT = { has_law = cr_councilor_gender_law_2 }
					NOT = { has_law = cr_councilor_gender_law_3 }
					NOT = { has_law = cr_councilor_gender_law_4 }
				}
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.25 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_councilor_gender_law_1
				revoke_law = cr_councilor_gender_law_2
				revoke_law = cr_councilor_gender_law_3
				revoke_law = cr_councilor_gender_law_4
			}
		}
	}

	cr_councilor_gender_law_1 = {
		group = cr_councilor_gender_law

		allow = {
			OR = {
				has_law = cr_councilor_gender_law_0
				has_law = cr_councilor_gender_law_2
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.5 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_councilor_gender_law_0
				revoke_law = cr_councilor_gender_law_2
				revoke_law = cr_councilor_gender_law_3
				revoke_law = cr_councilor_gender_law_4
			}
		}
	}

	cr_councilor_gender_law_2 = {
		group = cr_councilor_gender_law

		allow = {
			OR = {
				has_law = cr_councilor_gender_law_1
				has_law = cr_councilor_gender_law_3
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.5 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_councilor_gender_law_0
				revoke_law = cr_councilor_gender_law_1
				revoke_law = cr_councilor_gender_law_3
				revoke_law = cr_councilor_gender_law_4
			}
		}
	}

	cr_councilor_gender_law_3 = {
		group = cr_councilor_gender_law

		allow = {
			OR = {
				has_law = cr_councilor_gender_law_2
				has_law = cr_councilor_gender_law_4
			}
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.5 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_councilor_gender_law_0
				revoke_law = cr_councilor_gender_law_1
				revoke_law = cr_councilor_gender_law_2
				revoke_law = cr_councilor_gender_law_4
			}
		}
	}

	cr_councilor_gender_law_4 = {
		group = cr_councilor_gender_law

		allow = {
			has_law = cr_councilor_gender_law_3
		}

		potential = {
			higher_tier_than = duke
			holy_order = no
		}

		revoke_allowed = { always = no }
		ai_will_do = { factor = 0.25 }
		ai_will_revoke = { factor = 0 }

		effect = {
			hidden_tooltip = {
				revoke_law = cr_councilor_gender_law_0
				revoke_law = cr_councilor_gender_law_1
				revoke_law = cr_councilor_gender_law_2
				revoke_law = cr_councilor_gender_law_3
			}
		}
	}

	# Public exhibition

	cr_public_exhibition_law_0 = {
		group = cr_public_exhibition_law
		default = yes

		allow = {
			OR = {
				has_law = cr_public_exhibition_law_1
				AND = {
					NOT = { has_law = cr_public_exhibition_law_0 }
					NOT = { has_law = cr_public_exhibition_law_1 }
					NOT = { has_law = cr_public_exhibition_law_2 }
					NOT = { has_law = cr_public_exhibition_law_3 }
					NOT = { has_law = cr_public_exhibition_law_4 }
				}
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_public_exhibition_law_1
				revoke_law = cr_public_exhibition_law_2
				revoke_law = cr_public_exhibition_law_3
				revoke_law = cr_public_exhibition_law_4
			}
		}

		vassal_opinion = -5
		city_opinion = -5
		temple_opinion = -3
	}

	cr_public_exhibition_law_1 = {
		group = cr_public_exhibition_law

		allow = {
			OR = {
				has_law = cr_public_exhibition_law_0
				has_law = cr_public_exhibition_law_2
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.25
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_public_exhibition_law_0
				revoke_law = cr_public_exhibition_law_2
				revoke_law = cr_public_exhibition_law_3
				revoke_law = cr_public_exhibition_law_4
			}
		}

		vassal_opinion = -2
		city_opinion = -2
		temple_opinion = -1
	}

	cr_public_exhibition_law_2 = {
		group = cr_public_exhibition_law
		
		allow = {
			OR = {
				has_law = cr_public_exhibition_law_1
				has_law = cr_public_exhibition_law_3
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_public_exhibition_law_0
				revoke_law = cr_public_exhibition_law_1
				revoke_law = cr_public_exhibition_law_3
				revoke_law = cr_public_exhibition_law_4
			}
		}

		city_opinion = 2
		temple_opinion = 1
	}

	cr_public_exhibition_law_3 = {
		group = cr_public_exhibition_law

		allow = {
			OR = {
				has_law = cr_public_exhibition_law_2
				has_law = cr_public_exhibition_law_4
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.75
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_public_exhibition_law_0
				revoke_law = cr_public_exhibition_law_1
				revoke_law = cr_public_exhibition_law_2
				revoke_law = cr_public_exhibition_law_4
			}
		}

		vassal_opinion = 4
		city_opinion = 5
		temple_opinion = 4
	}

	cr_public_exhibition_law_4 = {
		group = cr_public_exhibition_law

		allow = {
			has_law = cr_public_exhibition_law_3
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.5
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_public_exhibition_law_0
				revoke_law = cr_public_exhibition_law_1
				revoke_law = cr_public_exhibition_law_2
				revoke_law = cr_public_exhibition_law_3
			}
		}

		vassal_opinion = 8
		city_opinion = 10
		temple_opinion = 8
	}

	# Arcane Law
	# Dormant fantasy-submod hook. The core keeps this design commented out
	# so magic has a stable future contract without appearing in ordinary
	# Carnal Realms games. The fantasy submod should define the magic game
	# rule and provide an uncommented version of these laws.
	#
	# cr_arcane_law_0 = Arcane Custom
	#   default baseline; magi live by local custom and private patronage.
	#	Suggested effects: 
	#		
	#
	# cr_arcane_law_1 = Protected Magi
	#   suggested effects: 
	#	unit_defensive = .05, unit_offensive = .05 with both being custom unit called wizards
	#
	# cr_arcane_law_2 = Privileged Towers
	#   suggested effects: 
	# 	unit_defensive = .1, unit_offensive = .1 with both being custom unit called wizards
	#
	# cr_arcane_law_3 = Magi of the Crown
	#   suggested effects: 
	#   unit_defensive = .15, unit_offensive = .15 with both being custom unit called wizards
	#
	# Future potential gate for each uncommented tier:
	#   has_game_rule = { name = cr_magic value = enabled }
	#	
	# Wizard Unit Type
	#	my_special_unit = {
    #	morale = 4
    #	maintenance = 3
    #	phase_skirmish_attack = 1.5
    #	phase_melee_attack = 5
    #	phase_pursue_attack = 3
    #	phase_skirmish_defense = 1
    #	phase_melee_defense = 1
    #	phase_pursue_defense = 1
    #	base_type = archer
	#
	# Building
	#	Player is shown the cultural and wizard troop building. Due to the hard coding of CK2 once the player selects on they are locked out of selecting the other.
	#	Wizard Tower (produces 10 wizard units) [requires cr_arcane_law_1 to build) [title of count to build it]
	#	Small Wizard Tower Network (3 baronies max of a single settlement type) (produces +20 wizard units) (requires cr_arcane_law_2 to build) [title of duke to build this]
	#	Large Wizard Tower Network (1 duchy worth of baronies of a single settlement type) (produces +60 wizard units) (requires cr_arcane_law_3 to build) [title of king and emperor to build this]
	#}

	# Commerce and Guilds

	cr_commerce_law_0 = {
		group = cr_commerce_law
		default = yes

		allow = {
			OR = {
				has_law = cr_commerce_law_1
				AND = {
					NOT = { has_law = cr_commerce_law_0 }
					NOT = { has_law = cr_commerce_law_1 }
					NOT = { has_law = cr_commerce_law_2 }
					NOT = { has_law = cr_commerce_law_3 }
				}
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_commerce_law_1
				revoke_law = cr_commerce_law_2
				revoke_law = cr_commerce_law_3
			}
		}

		tax_income = -0.5
		city_opinion = 2
	}

	cr_commerce_law_1 = {
		group = cr_commerce_law
		
		allow = {
			OR = {
				has_law = cr_commerce_law_0
				has_law = cr_commerce_law_2
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_commerce_law_0
				revoke_law = cr_commerce_law_2
				revoke_law = cr_commerce_law_3
			}
		}
		tax_income = 1
		city_opinion = 2
	}

	cr_commerce_law_2 = {
		group = cr_commerce_law

		allow = {
			OR = {
				has_law = cr_commerce_law_1
				has_law = cr_commerce_law_3
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.75
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_commerce_law_0
				revoke_law = cr_commerce_law_1
				revoke_law = cr_commerce_law_3
			}
		}

		tax_income = 2.5
		city_opinion = 5
	}

	cr_commerce_law_3 = {
		group = cr_commerce_law

		allow = {
			has_law = cr_commerce_law_2
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.5
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_commerce_law_0
				revoke_law = cr_commerce_law_1
				revoke_law = cr_commerce_law_2
			}
		}

		tax_income = 5
		city_opinion = 8
		temple_opinion = 2
	}

	# Adventuring Charter

	cr_adventuring_law_0 = {
		group = cr_adventuring_law
		default = yes

		allow = {
			OR = {
				has_law = cr_adventuring_law_1
				AND = {
					NOT = { has_law = cr_adventuring_law_0 }
					NOT = { has_law = cr_adventuring_law_1 }
					NOT = { has_law = cr_adventuring_law_2 }
					NOT = { has_law = cr_adventuring_law_3 }
				}
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_adventuring_law_1
				revoke_law = cr_adventuring_law_2
				revoke_law = cr_adventuring_law_3
			}
		}
	}

	cr_adventuring_law_1 = {
		group = cr_adventuring_law

		allow = {
			OR = {
				has_law = cr_adventuring_law_0
				has_law = cr_adventuring_law_2
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.75
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_adventuring_law_0
				revoke_law = cr_adventuring_law_2
				revoke_law = cr_adventuring_law_3
			}
		}

		city_opinion = 2
		city_vassal_max_levy = .05
		tax_income = 1
	}

	cr_adventuring_law_2 = {
		group = cr_adventuring_law

		allow = {
			OR = {
				has_law = cr_adventuring_law_1
				has_law = cr_adventuring_law_3
			}
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.5
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_adventuring_law_0
				revoke_law = cr_adventuring_law_1
				revoke_law = cr_adventuring_law_3
			}
		}

		city_opinion = 4
		city_vassal_max_levy = .1
		tax_income = 2.5
	}

	cr_adventuring_law_3 = {
		group = cr_adventuring_law

		allow = {
			has_law = cr_adventuring_law_2
		}
		potential = {
			higher_tier_than = duke
			holy_order = no
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0.25
		}
		ai_will_revoke = {
			factor = 0
		}
		effect = {
			hidden_tooltip = {
				revoke_law = cr_adventuring_law_0
				revoke_law = cr_adventuring_law_1
				revoke_law = cr_adventuring_law_2
			}
		}

		city_opinion = 6
		city_vassal_max_levy = .15
		tax_income = 5
	}
}
